package com.cskaoyan.utils;

import org.apache.shiro.crypto.SecureRandomNumberGenerator;
import org.apache.shiro.crypto.hash.Md5Hash;

/**
 * @Author tangjian
 * @Date 2021/10/22 14:33
 * @description
 */
public class ShiroEncryptUtil {

    // shiro 的加密
    // String salt = new SecureRandomNumberGenerator().nextBytes().toHex();
    // Md5Hash md5Hash = new Md5Hash(register.getPassword(), salt, 3);

    public static String md5(String pwd){
        String salt = new SecureRandomNumberGenerator().nextBytes().toHex();
        Md5Hash md5Hash = new Md5Hash(pwd, salt, 3);
        return md5Hash.toString();
    }
}
